<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>订单详情</title>

		<link href="/Public/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="/Public/assets/css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="/Public/css/personal.css" rel="stylesheet" type="text/css">
		<link href="/Public/css/orstyle.css" rel="stylesheet" type="text/css">

		<script src="/Public/assets/js/jquery.min.js"></script>
		<script src="/Public/assets/js/amazeui.js"></script>
		<script src="/Public/home/order.js"></script>	
		<script src="/Public/js/template-native.js"></script>

	</head>

	<body>
		<!--头 -->
		<header>
			<article>
				<div class="mt-logo">
					<!--顶部导航条 -->
					<include file="./Application/Home/View/Share/header.html" />
				</div>
			</article>
		</header>
            <div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="#">首页</a></li>
                                <li class="qc"><a href="#">闪购</a></li>
                                <li class="qc"><a href="#">限时抢</a></li>
                                <li class="qc"><a href="#">团购</a></li>
                                <li class="qc last"><a href="#">大包装</a></li>
							</ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="user-orderinfo">

						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单详情</strong> / <small>Order&nbsp;details</small></div>
						</div>
						<hr/>
						<!--进度条-->
						<div class="m-progress">
							<div class="m-progress-list">
								<span class="step-1 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
								<span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
								<span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
								<span class="step-4 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
								<span class="u-progress-placeholder"></span>
							</div>
							<div class="u-progress-bar total-steps-2">
								<div class="u-progress-bar-inner"></div>
							</div>
						</div>
						<div class="order-infoaside">
							<div class="order-logistics">
								<a href="logistics.html">
									<div class="icon-log">
										<i><img src="/Public/images/receive.png"></i>
									</div>
									<div class="latest-logistics">
										<p class="text">已签收,签收人是青年城签收，感谢使用天天快递，期待再次为您服务</p>
										<div class="time-list">
											<span class="date">2015-12-19</span><span class="week">周六</span><span class="time">15:35:42</span>
										</div>
										<div class="inquire">
											<span class="package-detail">物流：天天快递</span>
											<span class="package-detail">快递单号: </span>
											<span class="package-number">373269427868</span>
											<a href="logistics.html">查看</a>
										</div>
									</div>
									<span class="am-icon-angle-right icon"></span>
								</a>
								<div class="clear"></div>
							</div>
							<div class="order-addresslist" id="address-show">
								
							</div>
						</div>
						<div class="order-infomain">

							<div class="order-top">
								<div class="th th-item">
									<td class="td-inner">商品</td>
								</div>
								<div class="th th-price">
									<td class="td-inner">单价</td>
								</div>
								<div class="th th-number">
									<td class="td-inner">数量</td>
								</div>
								<div class="th th-operation">
									<td class="td-inner">商品操作</td>
								</div>
								<div class="th th-amount">
									<td class="td-inner">合计</td>
								</div>
								<div class="th th-status">
									<td class="td-inner">交易状态</td>
								</div>
								<div class="th th-change">
									<td class="td-inner">交易操作</td>
								</div>
							</div>

							<div class="order-main" id="paynow">

								
							</div>
						</div>
					</div>

				</div>
				<!--底部-->
				<include file="./Application/Home/View/Share/footer.html" />

			</div>
			<aside class="menu">
				<include file="./Application/Home/View/Share/menu.html" />

			</aside>
		</div>

	</body>

<!--寄取地址-->	
<script id="address-list-tql" type="text/html">
<%var address = data.address%>
<div class="order-address">
	<div class="icon-add">
	</div>
	<p class="new-tit new-p-re">
		<span class="new-txt"><%=address.name%></span>
		<span class="new-txt-rd2"><%=address.telephone%></span>
	</p>
	<div class="new-mu_l2a new-p-re">
		<p class="new-mu_l2cw">
			<span class="title">收货地址：</span>
			<span class="province"><%=address.province%></span>
			<span class="city"><%=address.city%></span>
			<span class="dist"><%=address.area%></span>
			<span class="street"><%=address.intro%></span></p>
	</div>
</div>
</script>


<!--当前订单-->
<script id="paynow-list-tql" type="text/html">
	<div class="order-status5">
		<div class="order-title">
			<div class="dd-num">订单编号：<a href="javascript:;" class="orderid"><%=data.order_id%></a></div>
			<span>成交时间：<%=dateFormat(data.addtime)%></span>
			<!--    <em>店铺：小桔灯</em>-->
		</div>
		<div class="order-content">
			<div class="order-left">
				<%var reply = data.reply%>
				<%for (var j=0;j<reply.length;j++) {%>
				<ul class="item-list">
					<li class="td td-item">
						<div class="item-pic">
							<a href="#" class="J_MakePoint">
								<img src="<%=reply[j].head_img%>" width="50" height="50" class="itempic J_ItemImg">
							</a>
						</div>
						<div class="item-info">
							<div class="item-basic-info">
								<a href="#">
									<p><%=reply[j].ware_name%></p>
									<p class="info-little"><%=reply[j].ware_cart%>：<%=reply[j].cart_list%>
									</p>
								</a>
							</div>
						</div>
					</li>
					<li class="td td-price">
						<div class="item-price">
							<%=reply[j].price%>
						</div>
					</li>
					<li class="td td-number">
						<div class="item-number">
							<span>×</span><%=reply[j].cart_num%>
						</div>
					</li>
					<li class="td td-operation">
						<div class="item-operation">
							
						</div>
					</li>
				</ul>
				<%}%>
			</div>
			<div class="order-right">
				<li class="td td-amount">
					<div class="item-amount">
						合计：<%=data.payprice%>
						<p>含运费：<span><%=data.tips%></span></p>
					</div>
				</li>
				<div class="move-right">
					<%if (data.status == 1) {%>
					<li class="td td-status">
						<div class="item-status">
							<p class="Mystatus"><a href="/home/pay/pay?order_id=<%=data.order_id%>">等待买家付款</a></p>
							
						</div>
					</li>
					<li class="td td-change">
						<a onclick="delware(this);" class="am-btn am-btn-danger anniu">
							删除订单</a>
					</li>
					<%}%>
					<%if (data.status == 2) {%>
					<li class="td td-status">
						<div class="item-status">
							<p class="Mystatus">买家已付款</p>
							
						</div>
					</li>
					<li class="td td-change">
						<div class="am-btn am-btn-danger anniu">
							提醒发货</div>
					</li>
					<%}%>
					<%if (data.status == 3) {%>
					<li class="td td-status">
						<div class="item-status">
							<p class="Mystatus">卖家已发货</p>
							
							<p class="order-info"><a href="/home/user/logistics">查看物流</a></p>
							<p class="order-info"><a href="#">延长收货</a></p>
						</div>
					</li>
					<li class="td td-change">
						<input type="hidden" class="status" value="<%=data.status%>">
						<a onclick="warereal(this);" class="am-btn am-btn-danger anniu">
							确认收货</a>
					</li>
					<%}%>
					<%if (data.status == 4) {%>
					<li class="td td-status">
						<div class="item-status">
							<p class="Mystatus">交易成功</p>
							
							<p class="order-info"><a href="/home/user/logistics">查看物流</a></p>
						</div>
					</li>
					<li class="td td-change">
						<div class="am-btn am-btn-danger anniu">
							立刻评价</div>
					</li>
					<%}%>
					<%if (data.status == 5) {%>
					<li class="td td-status">
						<div class="item-status">
							<p class="Mystatus">已完成</p>
							
							<p class="order-info"><a href="/home/user/logistics">查看物流</a></p>
						</div>
					</li>
					<%}%>
				</div>
			</div>
		</div>
	</div>
</script>


<script>
function getLocalTime(nS) {     
	return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");      
}    
function getprogram(name) { 
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r != null) return unescape(r[2]); return null; 
} 
var order_id = getprogram('order_id');

//确认收货接口
function warereal(obj){
	var order_id = $(obj).parents('.order-content').prev('.order-title').find('.orderid').html();
	
	$.post('/Api/order/warereal' , {order_id:order_id} , function(ret){
		if( ret.status == true){
			alert(ret.data);
			window.location.href="";
		}
		else{
			alert(ret.data);
		}
	});
}

//删除订单接口
function delware(obj){
	var order_id = $(obj).parents('.order-content').prev('.order-title').find('.orderid').html();
	
	$.post('/Api/order/delware' , {order_id:order_id} , function(ret){
		if( ret.status == true){
			alert(ret.data);
			window.location.href="";
		}
		else{
			alert(ret.data);
		}
	});
}

ORDER.orderinfocheck();
</script>
</html>
